﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CommunityToolkit.Mvvm.Messaging;
using 多协议通信平台.Models;
using 多协议通信平台.Msg;

namespace 多协议通信平台.Views.Dialog
{
    /// <summary>
    /// FinsPointEditDialog.xaml 的交互逻辑
    /// </summary>
    public partial class FinsPointEditDialog : UserControl
    {
        public FinsPointEditDialog()
        {
            InitializeComponent();
        }

 
        public DataPoint FinsPoint
        {
            get { return (DataPoint)GetValue(FinsPointProperty); }
            set { SetValue(FinsPointProperty, value); }
        }

        public static readonly DependencyProperty FinsPointProperty =
            DependencyProperty.Register("FinsPoint", typeof(DataPoint), typeof(FinsPointEditDialog), new PropertyMetadata());


        private void Close_Button_Click(object sender, RoutedEventArgs e)
        {
            this.Visibility = Visibility.Collapsed;
        }

        private void Confirm_Button_Click(object sender, RoutedEventArgs e)
        {
            WeakReferenceMessenger.Default.Send(new NotifyMessage(FinsPoint) { MsgType = "Edit"});
            this.Visibility = Visibility.Collapsed;
        }
    }
}
